<template>
  <ych-modal
    :fullscreen="false"
    :title="title"
    :visible="visible"
    :destroyOnClose="true"
    @cancel="handleCancel">

    <a-tabs size="small" v-model="activeKey" @change="handleChange">
      <a-tab-pane :tab="$t('m.eform.appgroup.other.current_app')" :key="comp[0]" :forceRender="true">
        <act-app-view-table-list :ref="comp[0]" :radio="radio" :groupId="groupId"
                                 :initSelectedKeys="selectedRowKeys"
                                 :initSelectedRows="selectionRows"
                                 @setSelectedRowKeys = "setSelectedRowKeys"
                                 @setSelectionRows = "setSelectionRows"
                                 @selected="handleOk"></act-app-view-table-list>
      </a-tab-pane>
      <a-tab-pane :tab="$t('m.eform.appgroup.other.common_app')" :key="comp[1]" :forceRender="true">
        <act-app-view-table-common-list :ref="comp[1]" :radio="radio" :groupId="groupId"
                                        :initSelectedKeys="selectedRowKeys"
                                        :initSelectedRows="selectionRows"
                                        @setSelectedRowKeys = "setSelectedRowKeys"
                                        @setSelectionRows = "setSelectionRows"
                                        @selected="handleOk"></act-app-view-table-common-list>
      </a-tab-pane>
    </a-tabs>

    <template slot="footer">
      <a-button key="back" @click="handleCancel">{{ $t('m.common.button.close') }}</a-button>
      <a-button key="handleClear" @click="handleClear">{{ $t('m.common.button.clear') }}</a-button>
      <a-button key="submit" type="primary" @click="handleOk">{{ $t('m.common.button.ok') }}</a-button>
    </template>

  </ych-modal>
</template>

<script>

import ActAppViewTableList from '../list/ActAppViewTableList'
import { SelectDialogMixin } from './SelectDialogMixin'
import ActAppViewTableCommonList from '../list/ActAppViewTableCommonList'

export default {
  name: 'SelectViewTableDialog',
  mixins: [SelectDialogMixin],
  components: {
    ActAppViewTableList,
    ActAppViewTableCommonList
  },
  data() {
    return {
      title: this.$t('m.eform.formDesign.label.xuan-ze-ye-mian')
    }
  },
  methods: {}
}
</script>
